package com.omkarpatil.learningjpa2.mapping.onetoone.fk.bidi;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity(name = "OtoFkBidiDesk") @Table(name = "oto_fk_bidi_desk")
public class Desk {

	private int id;
	private String number;
	private Employee employee;
	
	public Desk() {}
	
	public Desk(String number) {
		this.number = number;
	}

	@Id @GeneratedValue @Column(name="desk_id")
	public int getId() {
		return id;
	}
	
	private void setId(int id) {
		this.id = id;
	}

	@Column(nullable = false, length = 10)
	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	@OneToOne(mappedBy = "desk")
	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}	
}
